﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;
using System.Diagnostics;
using System.IO;

namespace Samurai.Client
{
    public class OpenMovieCommand : ICommand
    {
        public bool CanExecute(object parameter)
        {
            return true;
        }

        public event EventHandler CanExecuteChanged;

        public void Execute(object parameter)
        {
            if (parameter != null)
            {
                var directoryName = parameter.ToString();
                if (Directory.Exists(directoryName))
                    Process.Start(directoryName);
            }
        }
    }
}
